package graphics.tools;
import main.Config;
import tools.Point;

import graphics.system.Color;
import graphics.system.GLTools;
public final class Console {
	private static int pointer = 0;
	private static int nmessages = 15;
	private static String messages[] = new String[nmessages];
	private static Color color = Color.white;
	public static float width, height;
	public Console() {
	}
	public static void print(String s) {
		messages[pointer] = s;
		pointer++;
		if (pointer == nmessages) {
			pointer = 0;
		}
	}
	public static void draw() {
		int cp = pointer;
		int line = 0;
		GLTools.drawRect(new Point(width / 2, height), width, 500, 0, new Color(0, 0, 0, 0.8f));
		while (cp < nmessages) {
			if (messages[cp] != null)
				GLTools.drawText(10, height - line * 16, messages[cp], color);
			cp++;
			line++;
		}
		cp = 0;
		while (cp < pointer) {
			if (messages[cp] != null)
				GLTools.drawText(10, height - line * 16, messages[cp], color);
			cp++;
			line++;
		}
	}
	public static void printP(String k) {
		print(k);
	}
	public static void printG(String k) {
		print(k);
	}
	public static void printN(String k) {
		print(k);
	}
	public static void printGame(String k) {
		print(k);
	}
	public static void printFile(String string) {
		print(string);
	}
}
